exports.UITextAlert = UI.View.subclass(
{
    classname: 'UITextAlert',
    
    initialize: function(text) 
    {
 //   	this.setFrame([TCUtil.getAdjustedX(0),TCUtil.getAdjustedY(0),TCUtil.getAdjustedX(320),TCUtil.getAdjustedY(480)]);
 		//this.setGradient({ corners: '0 0 0 0', outerLine: "00000000 0", gradient: [ "F0000000 0.0", "F0000000 0.1" ] });
		this._backgroundImage = null;
		if(!text)
		{
			text = "";
		}
		this._text = text
    },
	
	createView: function() 
	{
		//frame, image, gradient, gravity, scale
//		this._view = UIFactory.getView([TCUtil.getAdjustedX(0),TCUtil.getAdjustedY(0),TCUtil.getAdjustedX(200),TCUtil.getAdjustedY(200));
		var backgroundPath = this.getBaseResourcePath() + "bubble.png";
		
		this._backgroundImage = UIFactory.getImage([TCUtil.getAdjustedX(0),TCUtil.getAdjustedY(0),TCUtil.getAdjustedX(200),TCUtil.getAdjustedY(200)], backgroundPath);
		this.addChild(this._backgroundImage);
		
		this._textArea = UIFactory.getTextArea([TCUtil.getAdjustedX(10), TCUtil.getAdjustedY(0), TCUtil.getAdjustedX(180), TCUtil.getAdjustedY(170)], this._text, TCUtil.getAdjustedFontSize(70), UI.ViewGeometry.Gravity.Center, '000000');
		this.addChild(this._textArea);
	},
	
	show: function()
	{
		NGWindow.document.addChild(this);
	},
	
	setCurrentPosition: function(position)
	{
		if(position)
		{

			this.setFrame([position[0] ,position[1], TCUtil.getAdjustedX(200), TCUtil.getAdjustedY(200)]);
		}
	},
	
	setFrame: function($super, frame)
	{
		$super(frame);
	},
	
	
	getBaseResourcePath: function()
	{
		return "./Content/images/gamelayer/controllayer/tutorial/";
	},
	
	updateText: function(text)
	{
		if(text)
		{
			this._textArea.setText(text);
		}
	},
	
	destroy: function ()
	{
		if(this._backgroundImage)
		{
			this._backgroundImage.destroy();
			this._backgroundImage = null;
		}
		if(this._textArea)
		{
			this._textArea.destroy();
			this._textArea = null;
		}
	}
});